package asia.hymsk.spring.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 花于陌上开
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Response {
    private Integer code;  //状态码，0为成功，1为失败
    private String msg;  //响应信息
    private Object data;

    public static Response success() {
        return new Response(0, "success", null);
    }

    public static Response success(String msg) {
        return new Response(0, msg, null);
    }


    public static Response success(String msg, Object data) {
        return new Response(0, msg, data);

    }

    public static Response error(String msg) {
        return new Response(1, msg, null);
    }
}
